<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var str = "hello Wrod"
        console.log(str.substr(0,3)) //hel,从第一个参数截取，截取到第三个参数结束，不包含
        console.log(str.split('')) //["h", "e", "l", "l", "o", " ", "W", "r", "o", "d"]
        console.log(str.length)
        console.log(str.indexOf('h'))
        console.log(str.lastIndexOf('d'))
        console.log(str.search('o'))
        console.log(str.slice(0,3))
        console.log(str.replace('llo',"哈哈"))
    </script>
</body>

</html>